<!DOCTYPE html>
<html>
<head>
    <title>终端列表</title>
    <#include "/header.html">
    <link type="text/css" rel="stylesheet" href="${request.contextPath}/statics/plugins/layui/css/layui.css">
    <style>
        .acceptInfo {
            display: none;
        }

        #upload div {
            margin: 10px auto;
        }

        #upload form {
            margin: 10px auto;
        }

        #upload div > div {
            margin-left: 225px;
            margin-top: 10px;
            margin-bottom: 30px;
        }
    </style>

</head>
<body>
<div id="rrapp" v-cloak>
    <div>
        <div class="grid-btn">
            <form class="form-inline">

                <div class="form-group ">
                    <input type="button" class="btn btn-default form-control" @click="rebackTer" value="机具回拨"/>
                    <input type="button" class="btn btn-default form-control" @click="distribuTer" value="机具分配"/>
                    <input type="button" class="btn btn-default form-control" @click="report" value="报备线上"/>
                    <input type="button" class="btn btn-default form-control" @click="terminalreback" value="终端回拨"/>
                </div>
            </form>

        </div>
        <!--<table id="jqGrid"></table>

        <div id="jqGridPager"></div>-->
    </div>


    <div v-show="showReBack" class="panel panel-default">
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label"> 起始终端号</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.startNo"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">结束终端号</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.endNo"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">终端类型</div>
                <div class="col-sm-8">
                    <select v-model.trim="q.terminalType" class="form-control">
                        <option v-for="ter in this.terminalTypes" :value="ter.terminalType">{{ter.terminalName}}
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">接收人姓名:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.name"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">接收人手机号码:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.phone"/>
                </div>
                <div class="col-sm-1">
                    <input type="button" class="btn btn-default" @click="checkAgent" value="查询"/>
                </div>
            </div>
            <div class="form-group" class="acceptInfo">
                <div class="col-sm-2 control-label"> 接收人id:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" readonly="readonly" v-model.trim="q.agentId"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="reback" value="确定"/>
                <input type="button" class="btn btn-primary" @click="rebackCangku" value="一键回拨库存"/>

            </div>
        </form>
    </div>


    <div v-show="showDistribu" class="panel panel-default">
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label"> 起始终端号</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.startNo"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">结束终端号</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.endNo"/>

                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">终端类型</div>
                <div class="col-sm-8">
                    <select v-model.trim="q.terminalType" class="form-control">
                        <option v-for="ter in this.terminalTypes" :value="ter.terminalType">{{ter.terminalName}}
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"> 接收人姓名:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control check" v-model.trim="q.name"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"> 接收人手机号码:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control check" v-model.trim="q.phone"/>

                </div>
                <div class="col-sm-1">
                    <input type="button" class="btn btn-default " value="查询" @click="checkAgent"/>
                </div>
            </div>
            <div class="form-group" class="acceptInfo">
                <div class="col-sm-2 control-label"> 接收人id:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" readonly="readonly" v-model.trim="q.agentId"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">是否线上:</div>
                <div class="col-sm-8 checkbox-custom checkbox-default control-label" style="text-align: left;">
                    <input type="checkbox" id="isOnline" @click="isOnline" v-model.trim="q.isOnline"/>
                    <label for="isOnline">线上</label>
                    <input type="checkbox" id="isActiver" @click="isOnline" v-model.trim="q.isActiver"/>
                    <label for="isActiver">是否是返现人</label>
                </div>
            </div>
            <div class="form-group" v-show="q.isOnline && q.isActiver">
                <div class="col-sm-2 control-label">返现金额:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.amount" />
                </div>
            </div>
            <div class="form-group" v-show="deptId==889326">
                <div class="col-sm-2 control-label">返现期限:</div>
                <div class="col-sm-8">
                    <input type="text" id="activDate" class="form-control" v-model.trim="q.activDueTime" readonly="readonly"/>
                </div>
            </div>
            <div class="form-group" v-show="deptId==889326">
                <div class="col-sm-2 control-label">返现金额:</div>
                <div class="col-sm-8">
                    <input type="text" class="form-control" v-model.trim="q.dueAmount"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="distribu" value="确定"/>

            </div>
        </form>
    </div>

    <div style="display: none;width: 100%" id="upload">
        <div style="width: 90%">
            <input type="button" v-show="isReport" class="btn btn-default form-control" @click="downReport"
                   value="下载报备线上模板">
            <input type="button" v-show="isReback" class="btn btn-default form-control" @click="downReback"
                   value="下载回拨终端模板">
            <form class="form-inline" id="uploadForm" style="width: 460px;margin-top: 50px">
            <span>
                导入数据:
            </span>
                <span>
                  <input type="file" name="file" id="file" class="btn btn-default form-control"
                         placeholder="请选择文件" readonly>
                  <input type="button" class="btn btn-default form-control" @click="reportTer" v-show="isReport"
                         value="导入"/>
                  <input type="button" class="btn btn-default form-control" @click="excelReback" v-show="isReback"
                         value="导入"/>
            </span>
            </form>
        </div>
    </div>
</div>


<script src="${request.contextPath}/statics/js/modules/terminal/handle.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/plugins/layui/layui.js"></script>
<script>
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        var nowTime = new Date().valueOf();
        //常规用法
        laydate.render({
            elem: '#activDate',
            format: 'yyyy-MM-dd',
            min: nowTime,
            done: function (value, date) {
                vm.q.activDueTime = value;
            }
        });

    });

</script>
</body>
</html>